home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
netdmo.exe
/
USELOG2.FRM
< prev
next >
Wrap
Text File
|
1993-12-10
|
3KB
|
124 lines
Version 1.00
BEGIN Form Uselog2
AutoRedraw = 0
BackColor = QBColor(1)
BorderStyle = 1
Caption = "Login Script"
ControlBox = -1
Enabled = -1
ForeColor = QBColor(0)
Height = Char(18)
Left = Char(9)
MaxButton = -1
MinButton = -1
MousePointer = 0
Tag = ""
Top = Char(3)
Visible = -1
Width = Char(63)
WindowState = 0
BEGIN TextBox Script
BackColor = QBColor(1)
BorderStyle = 1
DragMode = 0
Enabled = -1
ForeColor = QBColor(7)
Height = Char(13)
Left = Char(0)
MousePointer = 0
MultiLine = -1
ScrollBars = 0
TabIndex = 1
TabStop = -1
Tag = ""
Text = ""
Top = Char(0)
Visible = -1
Width = Char(61)
END
BEGIN CommandButton Command1
BackColor = QBColor(7)
Cancel = 0
Caption = "OK"
Default = 0
DragMode = 0
Enabled = -1
Height = Char(3)
Left = Char(21)
MousePointer = 0
TabIndex = 0
TabStop = -1
Tag = ""
Top = Char(13)
Visible = -1
Width = Char(19)
END
END
DECLARE SUB Command1_Click ()
'$FORM USELOG1
COMMON SHARED Uname$
COMMON SHARED UserID$
SUB Command1_Click ()
UNLOAD uselog2
USELOG1.SHOW
END SUB
SUB Form_Load ()
CRLF$ = CHR$(13) + CHR$(10)
user$ = UserID$
FOR i% = 1 TO 8 'Remove any leading zeros from user ID
namelen% = LEN(user$)
x% = VAL(MID$(user$, 1, 1))
IF x% <> 0 THEN
EXIT FOR
ELSE
user$ = MID$(user$, i% + 1, namelen%)
END IF
NEXT i%
filename$ = "Z:\mail\" + user$ + "\login"
uselog2.caption = " Login Script For: " + Uname$
ON LOCAL ERROR GOTO FileError
drivenow$ = CURDIR$ 'Check Network Drive
CHDRIVE "Z"
CHDRIVE drivenow$
OPEN filename$ FOR INPUT AS #1 'Read the Login Script
DO WHILE NOT EOF(1)
INPUT #1, linetext$
linetext$ = linetext$ + CRLF$
script.text = script.text + linetext$
LOOP
CLOSE #1
GOTO last
FileError:
errstring$ = ERROR$
errtype% = INSTR(errstring$, "Device unavailable")
IF errtype% > 0 THEN
msg$ = "There Is No Z: Drive. "
CHDRIVE drivenow$
script.text = " This program assumes that there is a drive Z: " + CRLF$ + CRLF$ + " Click on 'OK' to Continue. "
END IF
errtype% = INSTR(errstring$, "File not found")
IF errtype% > 0 THEN
msg$ = "Either this user doesn't have a personal login script file, " + CRLF$ + "or you do not have rights for this operation."
script.text = " Check your rights to the MAIL directory " + CRLF$ + " Click on 'OK' to Continue. "
END IF
MSGBOX (msg$), 0, "Error Getting Script"
RESUME recover
recover:
last:
END SUB
SUB Form_Unload (Cancel AS INTEGER)
USELOG1.SHOW
END SUB